﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Drawing;
using System.Windows.Forms;



namespace WindowsFormsApplication2
{
    
    public class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]

       

         public void Main()
         {
           public class ButtonEvent : Form
           {
            Button btn1;
            Button btn2;

                public void Form()
                {
            
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                Application.Run(new Form1());
                String[] ris2;
                ris2= new String[] {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F"};
                int B, N, Q, d;
 

                Form Form1;
                Form1.Width = 280;
                Form1.Height = 170;
                Form1.FormBorderStyle = FormBorderStyle.Fixed3D;
                Form1.Text = "Conversione numerica";

                Label label1;
                label1.Width = 200;
                label1.Height = 15;
                label1.Text = ("Scrivi la base in cui vuoi convertire qui:");
                label1.Location = new System.Drawing.Point(0,10);

                RichTextBox RichTextbox1;
                RichTextbox1.Size = new System.Drawing.Size(30,20);
                RichTextbox1.Location = new System.Drawing.Point(205,9);

                RichTextBox RichTextbox2;
                RichTextbox2.Size = new System.Drawing.Size(268,60);
                RichTextbox2.Location = new System.Drawing.Point(0,40);


                Button btn1, btn2;
                btn1.Text = "Avanti";
                btn2.Text = "Chiudi";
                btn1.Location = new System.Drawing.Point(5,110);
                btn2.Location = new System.Drawing.Point(190,110);
                btn2.Click = Application.Exit();
                btn1.Click =  
                                 B = int.Parse(RichTextbox1.Text);
                                 N = int.Parse(RichTextbox2.Text);
                                 Q = N/B;
                                 d = Q % B;
                                      while (Q > 0) ris2 = (Q / B); 
                             
                             

                btn1 = new Button();
                btn1.Text = "Button1";
                btn1.Location = new Point(10,10);
                btn1.Click = new System.EventHandler(btn1_Click);

                btn2 = new Button();
                btn1.Text = "Button1";
                btn1.Location = new Point(10,10);
                btn1.Click = new System.EventHandler(btn2_Click);

                btn1.Click;
                btn2.Click;
                Form1.Controls.Add(label1);
                Form1.Controls.Add(RichTextbox1);
                Form1.Controls.Add(RichTextbox2);
                Form1.Controls.Add(btn1);
                Form1.Controls.Add(btn2);

                Application.Run(Form1);
                }

              static void Main() 
              {
                Application.Run(new ButtonEvent());
              }

              private void btn1_Click(object sender, EventArgs e)
              {
                btn1.PerformClick();
              }

              private void btn2_Click(object sender, EventArgs e)
              {
                btn2.PerformClick();
              }
            


         }
        
    }
}

